#!/usr/bin/env python
# -*- coding: utf-8 -*-

from django.db import models
import os
import sys
import django

sys.path.append(r"web")
sys.path.append(r"algorithm")
sys.path.append(r"cta")

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'adam3.settings')
django.setup()


class ConceptBoard(models.Model):
    """
    概念板块
    """

    # 主键
    id = models.AutoField(primary_key=True)

    # 名称
    name = models.CharField(max_length=32, db_index=True, null=True, blank=True)

    # akshare代码
    akshare_code = models.CharField(max_length=32, db_index=True, null=True, blank=True)

    # myquant代码
    myquant_code = models.CharField(max_length=32, db_index=True, null=True, blank=True)

    # 创建时间
    create_time = models.DateTimeField(null=True, db_index=True, blank=True)

    class Meta:
        managed = True
        db_table = 'CONCEPT_BOARD'
        verbose_name = '概念板块'
        verbose_name_plural = verbose_name
        # 单列索引
        # indexes = [
        #     models.Index(fields=['code']),
        #     models.Index(fields=['k_line_period_type']),
        #     models.Index(fields=['begin_time']),
        #     models.Index(fields=['end_time']),
        #     models.Index(fields=['name']),
        # ]
        # 联合索引
        # index_together = [('id')]
